#include "stdafx.h"
#include "Airport.h"
#include <list>
#include <string>
#include "AirportManager.h"
#include "GroundTrafficController.h"
#include "AirlineRep.h"
#include "GateStand.h"
#include "LongTermStand.h"
#include "ArrivalBoard.h"
#include "DepartureBoard.h"
#include "InformationBoard.h"

using namespace std;

/*------------------------------------------------------------
/ Airport
/ Description: default constructor 
/ Parameters: N/A
/ Return: N/A
------------------------------------------------------------*/
Airport::Airport(void){
<<<<<<< .mine
	airportID = "YYZPearson";
	airportLocation = "";
	airportManager = new AirportManager();
	

=======
	airportID = "YYZPearson";
	airportLocation = "";
	airportManager = new AirportManager();
>>>>>>> .r38
}

/*------------------------------------------------------------
/ Airport
/ Description: alternate constructor
/ Parameters: 
/	_airportID: unique identifier for airport
/	_airportLocation: geographical location of airport
/	_airportManager: 
/	_gtcAccount:
/	_airlineRepList: list of AirlineReps working at Airport
/	_gateStandList: list of GateStands available at Airport
/	_longTermStandList: list of LongTermStands available at Airport
/	arrivalBoard:
/	departureBoard:
/	informationBoard:
/ Return: N/A
------------------------------------------------------------*/
Airport::Airport(std::string _airportID, std::string _airportLocation, AirportManager _airportManager, GroundTrafficController _gtcAccount, std::list<AirlineRep> _airlineRepList, ArrivalBoard arrivalBoard, DepartureBoard departureBoard, InformationBoard informationBoard){
	airportID = _airportID;
	airportLocation = _airportLocation;
<<<<<<< .mine
	*airportManager = _airportManager;
	*gtcAccount = _gtcAccount;
	std::list<AirlineRep> *airlineRepList = new std::list<AirlineRep> ();
	std::list<Flight> *flightList = new std::list<Flight> ();
=======
	*airportManager = _airportManager;
	*gtcAccount = _gtcAccount;
	std::list<AirlineRep> *airlineRepList = new std::list<AirlineRep> ();
	//std::list<GateStand> *gateStandList = new std::list<GateStand> ();
	//std::list<LongTermStand> *longTermStandList = new std::list<LongTermStand> ();
	std::list<Flight> *flightList = new std::list<Flight> ();
>>>>>>> .r38
}

/*------------------------------------------------------------
/ ~Airport
/ Description: default constructor 
/ Parameters: N/A
/ Return: N/A
------------------------------------------------------------*/
Airport::~Airport(void){
}

void Airport::displayBoard(){

}


int Airport::addToFlightList(Flight* f){

    //CODE IN
	return 0;
}

int Airport::removeFromFlightList(string id){

/*
	if (flightList.empty())
		return -1;
	
	list<Flight*>::iterator fIt, remIt;
	int index = 0;
	for (fIt=flightList.begin(); fIt!=flightList.end();fIt++){
		if (fIt->getFlightID().compare(id) != 0)
			index++;
	}
	
	//Advancing index by 2 makes index > size of list even if the flight
	//being deleted is the last object in the list. If this is the case the
	//flight with id was not found and could not be deleted.
	index += 2;
	if (index > aircraftList.size())
		return -1;

	advance (remIt, index);	//removeIt should be pointing at element with id from parameter
	flightList.erase(remIt);	//remove element from aircraftList

    */

	return 0;
}

int Airport::changeFlightID(string f1, string f2){
	//if list is empty, no ids to change; function failed
	//prevents list from being needlessly traversed
	
    /*if (flightList.empty())
		return -1;
	
	list<Flight*>::iterator fIt;
	
	//look at each Flight for id to change; if a match, change it
	for (fIt=flightList.begin(); fIt!=flightList.end();fIt++){
		if (fIt->getFlightID().compare(id) == 0){
			fIt->setFlightID(f2);
			return 0;	//id has been changed, return successfully
		}
	}
	
	//if no id matching f1 was found, function failed */
	return -1;
}

list<Flight>* Airport::getFlightList(){
	return flightList;
<<<<<<< .mine
}

void Airport::uploadAirportData (){

=======
}

void Airport::uploadAirportData (){

}

void Airport::exportAirportData (){

>>>>>>> .r38
}